<div class="dialog">
    <table>
        <tbody>
        
            <tr class="prop">
                <td valign="top" class="name"><g:message code="marketPriceResearch.region" default="Region" />:</td>
                <td valign="top" class="value"><g:link controller="region" action="show" id="${marketPriceResearchInstance?.region?.id}">${marketPriceResearchInstance?.region?.encodeAsHTML()}</g:link></td>
            
                <td valign="top" class="name"><g:message code="marketPriceResearch.market" default="Market" />:</td>
                <td valign="top" class="value"><g:link controller="market" action="show" id="${marketPriceResearchInstance?.market?.id}">${marketPriceResearchInstance?.market?.encodeAsHTML()}</g:link></td>
            
                <td valign="top" class="name"><g:message code="marketPriceResearch.date" default="Date" />:</td>
                <td valign="top" class="value"><g:formatDate date="${marketPriceResearchInstance?.date}" format="yyyy-MM-dd"/></td>
            </tr>
            
            <tr class="prop">
                <td valign="top" class="name"><g:message code="marketPriceResearch.approved" default="Approved" />:</td>
                <td valign="top" class="value"><g:formatBoolean boolean="${marketPriceResearchInstance?.approved}" /></td>
            
                <td valign="top" class="name"><g:message code="marketPriceResearch.dateCreated" default="Date Created" />:</td>
                <td valign="top" class="value"><g:formatDate date="${marketPriceResearchInstance?.dateCreated}" format="yyyy-MM-dd HH:mm:ss"/></td>
                        
                <td valign="top" class="name"><g:message code="marketPriceResearch.lastUpdated" default="Last Updated" />:</td>
                <td valign="top" class="value"><g:formatDate date="${marketPriceResearchInstance?.lastUpdated}" format="yyyy-MM-dd HH:mm:ss"/></td>
            </tr>
            
        </tbody>
    </table>
</div>
<div class="list">
    <table>
        <thead>
            <tr>
                <th><g:message code="marketPriceResearchDetail.serialNumber" default="serialNumber" /></th>
                <th><g:message code="marketPriceResearchDetail.product" default="Product" /></th>
                <th class="number"><g:message code="marketPriceResearchDetail.price" default="Price" /></th>
                <th><g:message code="marketPriceResearchDetail.promotion" default="Promotion" /></th>
           </tr>
        </thead>
        <tbody>
        <g:each in="${marketPriceResearchInstance?.details?.sort{it?.serialNumber}}" status="i" var="marketPriceResearchDetailInstance">
            <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                <td>${fieldValue(bean: marketPriceResearchDetailInstance, field: "serialNumber")}</td>
                <td>${fieldValue(bean: marketPriceResearchDetailInstance, field: "product")}</td>
                <td class="number"><g:formatNumber number="${marketPriceResearchDetailInstance.price}" format="###,##0.00"/></td>
                <td><g:formatBoolean boolean="${marketPriceResearchDetailInstance.promotion}" /></td>
            </tr>
        </g:each>
        </tbody>
    </table>
</div>
